import http from '../http'

export const shengpiApi=(id,status)=>
    http({
        url:"/purchase/updateStatus",
        method:"POST",
        data:{
            id,
            status
        }
    })


export  const getApi=(page,size)=>
    http({
        url:"/purchase/selectByPage",
        method:"POST",
        params:{
            page:page,
            size:size
        }
    })

export  const biaoge=()=>http({
    url:"PurchaseRequest/selectAll",
    method:"post",
    data:{

    }
})

export const delpi=(id)=>http({//删除调用接口
    url:"/purchase/deleteBatch",
    method:"post",
    params:{
        id
    }
})

export const goodclr=(purchase)=>http({//编辑
    url:"/PurchaseRequest/update",
    method:"post",
    params:{
        purchase:purchase
    }
})

export const mytianja=(id,nameber)=>http({
    url:"PurchaseRequest/updateByAmount?bigAmount",//添加
    method:"post",
    params:{
        id,
        nameber,
    }
})

export const shanchu=(id)=>http({
    url:"PurchaseRequest/delete",
    method:"post",
    params:{
        id
    }
})

export const xiansi=(page,size)=>http({
    url:"/PurchaseRequest/selectBySecondPage",
    method:"post",
    params:{
        page,
        size
    }
})

export const gohuo=()=>http({
    url:"PurchaseRequest/selectBySupplier",
    method:"post",
    params:{

    }
})

 export const fukuanxl=()=>({
     url:"/PurchaseRequest/selectByPayType",
     method:"post"
 })

export const jiajian=( bigAmount, id, pid, smallAmount)=>({
    url:"/PurchaseRequest/updateByAmount",
    method:"post",
    params:{
        bigAmount,
        id,
        pid,
        smallAmount
    }
})